package com.wechat.scheme.controller;

import com.wechat.scheme.exception.BusinessException;
import com.wechat.scheme.response.Response;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class DemoController {


    @GetMapping("/hello")
    public Response test(){
        return Response.succeed();
    }

    @GetMapping("/fail")
    public Response testFail(){
        return Response.fail( "fail!");
    }

    @GetMapping("/ex")
    public Response testEx() throws BusinessException {

        return Response.succeed( "success!");
    }

}
